#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;

int main(int argc, char const *argv[])
{
	// 创建单个内存
	int *val_1 = new int;
	*val_1 = 115;
	cout << "val_1=" << *val_1 << endl;

	// 创建单个内存 并初始化 在括号内 直接填写初始值 或者写变量
	int *val_2 = new int(2025);
	cout << "val_2=" << *val_2 << endl;
	int *val_3 = new int(*val_2);
	cout << "val_3=" << *val_3 << endl;

	// 创建多个内存空间

	int *arr = new int[5];

	// 写入数据

	for (int i = 0; i < 5; i++)
	{

		arr[i] = i;
	}

	// 读取数据

	for (int i = 0; i < 5; i++)
	{

		printf("arr[%d]=%d\n", i, i);
	}

	delete val_1;
	delete val_2;
	delete val_3;
	delete[] arr;
	return 0;
}
